Initial implementation of the sparse matrix.

@bsoetaer 
Tests pass when the contracts are disabled.
Good point - I don't believe it will affect the functionality of the existing matrix implementations, but the matrix builder should check too.