Added comments and tests to matrix class.