Clean and harden Transaction.

* Replace boolean parameter with enumerated type.
* Get rid of std::ref.
* 80-column cleanups.
* Replace a std::bind with a lambda.