Internal DataStore fixes

#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 in #219 )
- Tests are isolated and cleaned up prior to test 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
...or some other constant. I dont know when you need to run the tests.