Organise profile contributions by article

The profile of people with many contributions looked messy. This commit
tries to remedy this by grouping article contributions by (article,
language), and hiding everything but the article name by default. There
was also an inconsistency in header tag usage on the profile page, which
has been fixed in this commit.

This fixes #209.
Merge pull request #218 from stianjensen/cleaner-profile

Organise profile contributions by article
Fix mathjax extensions typo

Both extensions failed to load due to a typo
Merge pull request #248 from stianjensen/fix-mathjax-plugins

Fix mathjax extensions typo
Add caching

This commit adds a simple caching module and applies it to some of the
more expensive-yet-easy-to-cache parts of Wikipendium. Currently,
caching is configured to use the `LocMem` caching backend, which should
be 'good enough' for a project like Wikipendium. The added caching
module contains several decorators:

`@cache`

This is a dirt simple function caching decorator, which can accept an
optional `key` parameter, which may either be a string or a callable
that returns a string.

`@cache_model_method`

This is a wrapper for `@cache` that is aware of django model instances,
and uses a model's primary key to create a cache key unique for that
instance. This decorator is made to cache costly model function calls
that vary per instance.

`@cache_page_per_user`

This is a wrapper for `@cache` that emulates django's `@cache_page`, but
takes care to cache separately for each logged-in user, so as to not do
a "Kenneth, 36" [1].

All of these decorators cache with a cache timeout of infinity.

The decorators have been applied to the front page of Wikipendium, the
article page, and the single history page, as well as the model method
of an article content that renders the contained markdown to html. For
views that vary on more than their arguments alone, such as the
`article` view and the `history_single` view, it is recommended to
create a new function that explicitly lists the cache vary dependencies.

The caching introduced in this commit brings a front page load down from
480ms to 16ms, an article page load down from 252ms to 8ms, and a single
history page load down from 92ms to 20ms. All measurements were
performed locally on my laptop using Django's development server.

[1]: http://www.aftenposten.no/okonomi/innland/6789260.html
Merge pull request #247 from stianjensen/caching

Add caching
Make clone_prod_data use dumpdb
Switch the default article order to desc by date

This will put more relevant compendiums at the top of the frontpage
Closes #249
Add sitemap

Closes #245
Merge pull request #255 from stianjensen/sitemap

Add sitemap
Merge pull request #254 from stianjensen/fix-history-list-layout

Fix history list layout
Merge pull request #253 from stianjensen/default-sort-by-date

Switch the default article order to desc by date
Merge pull request #252 from stianjensen/fix-clone-prod-data

Make clone_prod_data use dumpdb
Allow UTF-8 characters in username

Closes #244
Strip special characters from URL

Closes #242
Refactor edit form.

Rewrites most of the edit form handling.

There were some bugs with the previous spaghetti, especially when
making an edit which caused a validation error. When rendering a form
with a validation error, fields were displayed incorrectly.

It also fixes several issues with merge conflicts.

To fix this issue properly I had to rewrite most of the form handling,
so here.
Merge pull request #256 from stianjensen/fix-urls

Fix urls
Refactor autocomplete

Rewrite of frontpage autocomplete to:
- increase readability
- avoid duplicate event binding, and move binding to parent element
- remove duplication of DOM code
- introduce an anchor element, so URLs are handled natively by the
  browser
- remove rendering artifacts during typing
- remove references to 'trie', as it's not really a trie anymore
Merge pull request #232 from stianjensen/fix-edit-form

Refactor edit form.