Emit a 'site_settings_loaded' signal when loading siteconfig.

Extensions may need to override loaded settings, such as adding
additional auth backends. In order to do that, it needs to ensure it can
operate on the settings after loading from siteconfig. This can now
be done through a new signal, 'site_settings_loaded'.
Enable usage of django.contrib.messages.

The Django messages framework has improved quite a bit since the early
days, and is now a useful thing to have in the admin UI. It already
stored cookies with these messages, but they just built up and were
never used or cleared. By activating the context processor, the admin UI
can provide much nicer responses to actions, such as deleting objects.

We can probably make use of this in some good ways going forward as
well.

While activating this, I noticed that output in the admin UI was wrong.
Our HTML was quite broken, since we never tested it before. This has
been fixed.
Fix an exception in the API when accessing file attachments without review UIs.

The thumbnail field in FileAttachment was accessing the review_ui without first
checking it for None-ness. Trivial fix.

Fixes bug 3145.

Reviewed at https://reviews.reviewboard.org/r/5032/
Merge branch 'release-1.7.x'
Merge remote-tracking branch 'upstream/master'