Sorry for the mega commit, this really spiralled way out of control I'm afraid :/

- The first major point is that a lot of these line changes are for formatting, to make the code more maintainable in my opinion. In short I've added a ton of line breaks, I've resisted as much as possible changing variable names.
- Fixes a couple of bugs in aggregate_json_ui.py
- Removed a load of front end code, in particular unneeded HTML and CSS that was mainly in there for aging compatibility.
- Generally neatened up the edges of the UI really.
- Still needs work but I've started to split out the Javascript files from the HTML itself, same goes for the CSS.

Going forward there is still a bit of structural work to do, mainly I'd like to adapt the urls to be more meaningful and change the file structure behind them to take advantage of that.
Fix a couple of regressions spotted by Danny and Alex.
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master'
Fixing session in stat_handlers
Removing premature function/connection wrapping

If you wrap functions on startup and on cherrypy init, they get wrapped
twice, which is a bit dodgy.
Handler fixes

Fix for empty handlers. Now checks if request handler exists before
wrapping.

Also minor fix for wrapping root handlers, as cannot have empty key in
config, so need to have special case for '/'.
Fixing postgres database wrapping

Needed to monkey patch the register_type method in psycopg2 to allow it
to recognise our wrapped classses as connections and cursors.
Merge pull request #120 from dannybutler/master

Several fixes