Mike refactor table sort

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

Some bitwise magic, makes -1 falsy and everything else truthy. :grin: