Quaternion conversion, add self test