Modify ChQuaternion.h to have it properly templated by Real.

Use the template parameter Real throughout.
Switch to using references where appropriate.
Clean up formatting.