Wrap transactions for pool

Start pool operations with a manual transaction, and commit as part of
flush.
Eliminate current warnings

Configure the transaction code for testing only, since it isn't
actually being used (move into a mod?).  Otherwise fix up a few
warnings about unused variables or dead code.