add support for promises
Merge pull request #55 from cesarandreu/promises

add support for promises