Fixes handling of disparate database connections.
Switches to ES6 promises from when.
Expands test suite to cover basic testing of transactions.