Eliminate Matrix#map_with_index

Instead, we can just use Matrix#map and Enumerator#with_index. It
involves a bit more logic to go from index to row and column, but I
think it's a small price to pay given that it removes a number of lines
of code and eliminates a monkey patch.