First steps towards reconnecting the Database when we lose connection

Losing connection stinks, but the conditions under which we may have to
restart the connection and (re-)execute a query for execution are hairy.
Let's start trying to do this right.