Refactor Transaction and Dataset

Replaces #231 

I rebased against master where some recent merged had created conflicts, fixed them up, and squashed.
Should we have this in docs/lib/node-semver/semver.js and include the LICENSE?