This looks great. I like how it normalises the shapes into paths too. But are there any tools to do this for the command line that "simplify" SVGs so your library won't have to worry about this?

Yes, SVGO is really good at this and other kinds of SVG optimisation and manipulation: https://github.com/svg/svgo/