Fix coordinate calculation in DMat::from_fn().

Hello, I was playing with your library and noticed that I was getting incorrect coordinates to my `DMat::from_fn` builder fn on the order of 2^64, and suspected a uint underflow.  

I changed the coordinate calculations in `DMat::from_fn` to `(i % nrows, i / nrows)`.  There's probably some slick way to avoid the integer division, but this at least works.

I also added a unit test to verify the new behavior.