Matrix: Implement mapMatrixWithIndex independently

Previously this was piggybacking off of mapMatrixWithIndexM
which would overflow the stack with large input
Matrix: Whitespace cleanup