refactor TransactionState, subclassing.

Change-Id: Idc822b4438ddbb44b9532fcab2375609e2de44d7