removing magic constants - use STATE_MASK everywhere
Always free transaction id when transaction is reverted or committed.
This will allow transaction id to be reused by other lately created transactions.
Avoiding stale data - access to transaction's state variable have to be synchronized