refactor Transaction, update docs

Transactions now have 4 states (disconnected, connected, open, and closed)
instead of ~6. The StateMachine base class has also been simplified (removed the
'errored' psuedo-state and replaced the method-swapping with __proto__ swapping).