Moved sparse_matrix type into its own module