Fixed broken build due to session/config cross-dependency

(related to #692)

There was a dependency chain like so:

Loading the configuration -> check the database -> keep track of
database check in session

But because we need the configuration to set up the session, this
created a cycle:

Session -> Configuration -> Check Database -> Session

...and this tripped things up.

The solution is to not store the database check in the session; instead,
we'll keep the database check timestamp in a file in app/cache.