Allow embedding of generated SVG in HTML by returning SVG only as string and not sending it to browser

also, fix doctype definition of SVG and remove dead code