support async promise and setImmediate. Fixes #484