datastore: refactor transaction & datastore.

Hello again!

I rearranged a few things, hopefully for the better. I'll leave comments. :)
mocha works without wildcards, and defaulting to test/ by default. You don't need to provide those flags.

~~~ js
"test": "mocha --reporter spec",
~~~

should just work.