Add switch to reverse order of tasks_by_time, with test

This adds a switch to choose whether or not you'd like the results of tasks_by_time to be reversed, along with tests.

It also modifies tasks_by_type and tasks_by_worker to add in this same switch, which is simply passed along to tasks_by_time.