Changed the API for with-transaction after discussion with @michaelklishin.