Issue 65

Fixes #65 and adds transaction logging.