datastore: refactor transaction & datastore.

Hello again!

I rearranged a few things, hopefully for the better. I'll leave comments. :)
The Transaction related tests were moved to their new `test/datastore/transaction.js` test file.