Added template parameters for friend functions

Got rid of the warning where the template types where missing for friend
function declarations.
Completed a working matrix class

Tested it in a small program. Operations work as expected. Will need to
add documentation and some real unit tests next.