Change implmentation a bit to use more Promises. Add tests. Patch version bump.