some cleanup on libquat, and added quaternion rotation.