refactored greydb interface in preparation for transaction support
implemented transaction support for bdb database driver