Initial implementation of the sparse matrix.

@bsoetaer 
Tests pass when the contracts are disabled.
That will pack both variables into an array, unfortunately.