Initial tests for setup_db
Refactor setup_db.

* Abstract passphrase.
* Remove unused `remove_db`.
* Remove unused `main` suite.
* Use `with` aggressively.
* Import modules, not names; simplify imports.