Added basic transaction logic and a test for timeouts