Miscellaneous code improvements for svg.js