Transaction commit fix

#186 
- Add test for nested transaction
- Commit supports nested transaction, but may only commit transaction on top of the transaction stack
- Saves data to disk after every successful commit (commit that is not just merging transactions)
- Modify test cases to make use of the singleton
- No extra test cases for #171 yet