Progress on optimizing memory writes.

Currently works for offset style memory accesses, going to port the idea to
indexed accesses and try to get insertion sort working...