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
Sorry, I don't quite get what you mean by these comments? Are you asking when do I need to run this method?
Basically I need to clear the xml_document and the data.xml stored for every new test that depends on the initial state.