Expose transactions to callers directly
Currently, users of transactions only interact with a transaction via the proxy of its identifier. While it worked just fine in the beginning where transactions didn't really do a lot, they start to become more complex and thus carry more information that may be of interest to the user.
So this MR exposes accessors of the transaction type such that callers can query them more easily instead of cramming everything into the cleanup function's return type.