SVG support

The commits in this pull request make format support generic and add SVG support via new draw_to_svg() function.