Refactor sparse/dense matrices.
Consolidated memory-mapped row-major matrix functionality.