Sort article list by tags by creation date.
Refactor inconsistent variables.
Reference article ids instead of slugs internally.

This removes the obligation of renaming keys if a slug changes in the
future. No external interfaces are broken.
Fix indentation.
Move common update logic into function.