Make sure database environments are setup correctly, including for development mode.

breakdown refactor on startup, OpenBazaarContext creation in its own method.