contents: Add rich comparisons to URLWrapper for easy sorting

There have been earlier attempts to sort categories and authors
[1,2,3], but they either sorted based on the object id [3], or only
sorted the main author and categories list.

This patch uses rich comparisons (keyed off URLWrapper.name, but
easily adjustable in subclasses) to make the objects sortable without
specifying a key for each sort.  For example, now

  {% for tag, articles in tags|sort %}

works as expected in a Jinja template.

The functools.total_ordering decorator fills in the missing rich
comparisons [4,5].

[1]: 877d454c8fa979343d4881a00977d9ac8786f178
[2]: 7f36e0ed20745c73886d96d4af303b0d858b8a53
[3]: d0ec18f4dbd623c55bdf4928ee7c363f699ef696
[4]: http://docs.python.org/2/library/functools.html#functools.total_ordering
[5]: http://docs.python.org/3/library/functools.html#functools.total_ordering