Internal fix

#171
Sorry for the big PR. After modifying the tests I found that there are so many mistakes in the current design and I need to fix them.
Summary:
- Tests for internals only (for API coming soon)
- Tests are isolated and cleaned up before if necessary (thanks to @evansb for finding this bug and helped me to fix it)
- Change in design: now all operations have to go through Transaction, for consistency of DataStore behaviour (without going through Transaction, commit is not invoked and file will not be saved to disk)
- Rollback is now useful for cleaning up (done in #199, cherry-picked here)
- Not sure if the current tests are unit enough, I feel that some components are very tightly coupled, it is impossible to separate them into different units for testing