Hopefully completed the first pass at refactoring webglapp.js.