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.
Well it's a bit belt-and-braces, as AFAICS the only way JobME can be removed is
when both hasVote and wantsVote are false. But perhaps worth leaving in,
as it's a direct test for what we really care about, and it's possibly that that
logic might change some day.