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.
FWIW, I don't think there's much benefit to ever allowing EEC to leak out. It's really a textual core-developer shibboleth signifying "some programmer screwed up the correspondence between in-memory checks and txn asserts", and if that's *all* we get out we lose a bunch of important context.

Doesn't need fixing, behaviour-preserving refactor, but I still think it shouldn't really leak out -- the only use for it I can see is an auto-retry layer at the state/api level, but I think that'd be better addressed with exponential backoff for retries in the txn package itself. (if you've already done that, cool, I didn't get all the way through the review yet)