Working with Jakob: added dmat iterators, rewrote and reworked MutableMatrix::to_matrix