Add support for promises.
Merge pull request #135 from gstoyanov/master

Add support for promises.