Move pagination link construction into function.
Move descending sort into sort_fields dict.
Simplify sorting in index_articles.