Completed TODOs, moved code to svg.js