Javascript Canvas Scenegraph