Concerning #575: Refactored sparsity pattern caching. Now working, but still not enabled.
Refactored sp_diag to allow caching
Fixes #575. Enabled sparsity pattern caching