Extract useful Q.js functions from http://github.com/EGreg/Q.js/blob/master/Q.js