Initial implementation of the sparse matrix.

@bsoetaer 
Tests pass when the contracts are disabled.
Index methods would be better with selector having a default value of :all I think but this would screw up how this function works.