Added support for Q and when.js