Initial implementation of the sparse matrix.

@bsoetaer 
Tests pass when the contracts are disabled.
I'll add a comment explaining the purpose of this class.