Working implementation of db backed session store
Refactoring, and beginnings of auth.

This cleans up the route definition code significantly. It also moves
all api routes to their own URI namespace (api/v{x})