Moved non-method maths::Matrix functions

External functions related to the maths::Matrix class have been moved to
a different header file.