Mike refactor table sort



<!---
@huboard:{"milestone_order":126.0,"order":25.875,"custom_state":""}
-->

Thing is, I can't comment on all lines (only those within a certain range of modified ones).