Transaction support

Closes #4

At first I had a phenomenon where tests would fail every now and then but it seems to have been fixed. Testing on other systems is very much required though.