added support for promises
version bumped to 0.4.0