DNM: Task Queue Compacting and Task Ordering

TBA...
Also need tests for:
- everything already in order
- empty list