Fixed db connection issue, fixed redirects to Friends handler

Now the engine/connection pool is created once per application, and a session is created once per request. This is in anticipation of async db requests