Initial implementation of the sparse matrix.

@bsoetaer 
Tests pass when the contracts are disabled.
Looks like you tried to make these lines work but didn't uncomment them. What is the intent here?