Moved db conn tester to 'state' for later refactoring.