datastore: refactor transaction & datastore.

Hello again!

I rearranged a few things, hopefully for the better. I'll leave comments. :)
Verifying changed files will always produce a bunch of red somewhere and all green elsewhere. I know it's not ideal, but these changes were somewhat intertwined. To write tests for a method on Dataset, I had to abstract the Transaction logic. http://www.diffchecker.com/egze03b1 will show the changes between the former `lib/datastore/index.js` and the new `lib/datastore/dataset.js` - I may have left out a comment or two that will make annotate the actual changes, which I'll go through and find now.