Add much more robust transaction support

Include transaction rollback so that it works
correctly when a transaction fails and adjust how
the watches will not be triggered unless the
transaction is successful.