Update matrices.h

Fixed some errors, added more methods, improved consistency and added an (UNTESTED) quaternion class. Use the latter at your own risk.