Implement commit and rollback.

Better late than never.

Closes #35.
Closes #34.