Add encoding to `canvas.toSVG(options)` - Closes #810

Add unit tests for canvas.toSVG