Improve debugging configuration

Move DEBUG to local_settings.py
Changing logging configuration so backtraces processing requests are logged
to the console.
Add LOG_SQL to local_settings.py to log SQL statements to the console.
Error report uploads

Allow controller machines to post error reports, which have, instead of
metrics, a error message, and a JSON-formatted syslog from the target
machine.

Display the error message and a link to the log on the target web page.
Add 'python manage.py prunelogs'

The prunelogs command deletes all but the last 5 logs for each
target.
Add templates for error pages

When not in debug mode, we need our own error page templates.