use hash move in sort (2010870)
Along with lots of bugfixes...