Cleans up and organizes several scattered functions and variables related to the BDB env. Class CDBInit() existed to provide a guaranteed-via-C++-destructor cleanup of the db environment.
A formal CDBEnv class provides all of this inside a single wrapper.
NOTES:
- Other db.cpp-related operations might be candidates for CDBEnv inclusion. This current commit was chosen as a good starting point, only encapsulating clearly-dbenv-related items.
- Further wrappers may easily encapsulate remaining direct bitdb.dbenv accesses, though it hardly seems worth it.
- CDBEnv is a starting point for easy cross-database transactions. BDB supports this, but bitcoin codebase hardcodes txn<->database association into CDB.