cleaned up a bunch of code, restructured rendering so that I can introduce WebGL at a later date, added a 'build' step to simplify example making