Added basic type class instances for Quaternion.

There are a few FIXMEs in there, some of which will be more challenging
than others to actually "fix".

Also, fixed a but in nroot.