Clean up / simplify the generated SVG output

The output is now a bit more compact and readable. It still validates as per http://validator.nu/ with the “SVG 1.1 + XHTML5 + MathML 3.0” setting.