added Quat.safeEulerAngles() for JS