convert to a promise-based interface
Merge pull request #3 from carrot/promise

Convert to a promise-based interface