Matrix function contracts, equals contract, and fixed other contracts th...

...at were failing tests.
@isupeene 
You should probably assert that both row and column size are equal.  Consider the following input and output:

```
[1, 2, 3, 4         [1, 2, 3,
 2, 3, 4, 5    =>    4, 2, 3,
 3, 4, 5, 6]         4, 5, 3,
                     4, 5, 6]