Changed distance() to be more memory efficient based on email from mailing list.

Changed the implementation so that it uses a smaller array and overwrites it on loop iterations.

http://forum.dlang.org/thread/rwrjgydeiytufcuiqaqk@forum.dlang.org
Apparently in this case :
` matrix(y,0)` is the same as ` matrix(0, y)` and I'm not sure if this distinction on this line vs few lines down below makes anything better.

Then I'd argue that since it's exactly the same as `_matrix[y]` just use it directly (only in this function) making the life of the optimizer that much simpler.