Sorting. closes robb#23
Define useful sorting blocks