Selected element SVG refactoring
This rewrites the SVG that displays the selected element when drawing a new polygon or when editing an existing one, making the points more "autonomous" elements that do not rely on a single general method to manage their events. The lines are also drawn separately, which could later allow implementing #867 (closed) or #843.
Closes #851 (closed): multiple checks have been put in place to prevent creating extra points when closing a polygon.
Edited by Erwan Rouchet