Port of three.js quaternions