This changeset makes sorting of ticket query results by milestone consistent with the ordering of milestones in the roadmap:
* First, completed milestones by completed date.
* Then, due milestones by due date.
* Finally, milestones without completed or due dates alphabetically.
One difference with the roadmap is that the alphabetical sort is not a "natural sort". So for milestones without completed or due dates, 0.10 will come before 0.9. There doesn't seem to be a way to do natural sorting in an SQL query.
The changeset also simplifies the management of ascending / descending sorting.
Closes #2209.