datastore: refactor transaction & datastore.

Hello again!

I rearranged a few things, hopefully for the better. I'll leave comments. :)
Transaction, formerly defined in `lib/datastore/index.js` was split into its own file, like `lib/datastore/dataset.js` was.