Transactions

Adds support for transactions.