Some commenting and clean up of code in canvasrenderer.js