Quaternion class. Templated. All functions + constructors inlined.