Add transactions to the Metadbm

Encloses all the add/update calls in a transaction to speed
up the process.