New txn package

Introduce a new state/txn package which contains the transaction functionality extracted from state/State. A new TransactionRunner interface is implemented which provides methods to i) run transactions directly without retries, ii) invoke a callback to get transactions to run and retry if there is contention. All the hooks and other related functionality is moved out of State. The new txn runner can now be used standalone outside of the State instance, and is also embedded in State.

The various callsites are all migrated to use the new infrastructure. A few unit tests are also added for the hooks functionality - these were missing before.
we'd need to return a txn.ErrInconsistentState that's properly handled by (backing off and?) just starting the next attempt. Just barfing is not appropriate here.

This is definitely a case that could use a better test -- there should have been one that failed here. (But I hadn't figured out the hooks idea at the time I wrote the code... sorry.) There's at least one more use of errRefresh with the same semantics in state, please make sure you hunt it down if I miss it in review.