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.