datastore: refactor transaction & datastore.

Hello again!

I rearranged a few things, hopefully for the better. I'll leave comments. :)
This is a sweet module I had never heard of which lets us override methods that are `require`'d from within the specified file. So, in this case, I'm telling it to use my fake `entity` object defined above when the `lib/datastore/index.js` says: `require('./entity')`. Pretty cool.