Refactors SVG api
Adds svg.js to the generic and singlefile builds
Fixes image and font embedding
Merge pull request #5188 from yurydelendik/svg-refact

Refactors some SVG api and includes svg.js in the build