Writing to SVG Files

I do not know if this is the wrong branch.
I do not know if you can read my comments in the commits, they explain whats going on.