js: improve listener sync/async detection
Merge pull request #6 from andrewschaaf/improve-async-detection

Improve listener sync/async detection