Rewrote quaternions.  Fixed several bugs