datastore: refactor transaction & datastore.

Hello again!

I rearranged a few things, hopefully for the better. I'll leave comments. :)
Simply refactored to create `this.connection` on the instance, allowing it to be reused later in `createTransaction`.