Just written my first Medium article on how to create a custom layer class module in Framer. I'm still a bit of a rookie so feedback would be much appreciated. Have a great weekend.
You can also select the SVG element using @._element.children. That way you don't have to add IDs to everything.
You could also use the new SVGLayer as the base. I'll document this soon. It's just a layer with a .svg property and a shortcut to create shapes.