Replace uses of defer with Promise constructor
Merge pull request #3 from neverfox/pull-request/promise-constructors

Replace uses of defer with Promise constructor