Improve performance of subset() and superset().

Using a different construction method for the sparse matrix used makes the methods a little faster. There is probably still room for improvement by refactoring to avoid the sparse matrix products.

Improvement in total runtime for SPE9 on my machine is approximately 10 seconds.