moved most of the three.js code into the renderer and cleaned it up a bit