Updating to latest threejs, refactoring