Simplify sorting and make sure that the sorts satisfy the comparator 'contract'

Changed the sort class to make sure that the comparators would be able to correctly sort and added a couple of helper methods to the task class to make that easier.

Also, reviewed the sort tests and added the two missing sort by date asc/desc tests.

Put the tasks in a spreadsheet to confirm the sort orders (it got too hard trying to do it in my head).

Should resolve issue 438 and 442.