Track sorting and listing improvements. (Bug 796305 and bug 841977)

Includes dependencies that have to land before this. ie will be rebased when time comes.