Update to latest tern
Switch to quaternions. Update three.js.