don't inline three.js; clean up, minor refactoring