Implements promises.
Merge pull request #3 from fardog/promises

Implements promises