Auth: Use DI for database reference

Use a single instance of our database API, and
pass it into auth.initialize
Database: Use cookies when keeping server active

We were trying to keep the server active by
connecting to it without authorization, so
naturally this didn't work very well.

And while we're here, let's reauth every
twelve hours with the CouchDB server, as
our cookies expire after a day.