Refactored the matrix class so that is can support 2x2 and 4x4 matrices. No changes to other classes were necessary due to some clever use of default template parameters.