Added hashCode to Quaternion

Quaternion was only overriding `equals()`, but not `hashCode()`. The methods are generated with Eclipse and slightly changed to make them shorter and keep the same behaviour of the old `equals()`.