Allow stacking of transactions

Closes #1166