Documentation, and quaternion optimizations and bug fixes