Fixed Euler to Quaternion conversion

Reported in #164. Fixed according to @Azaezel's comment, with a bonus googletest unit test based on the original test case. Obviously requires #706.