Decouple database tests from other unit tests.

And programmatically use Mocha.