use instanceof to determine whether an object is a Q promise.
revert isPromise and change only the condition inside function Q
Speed optimization: flush() went from 84.4ms to 76.7ms on MontageJS ToDo MVC
Strengthen CommonJS detection
Merge pull request #580

On the off chance that the numbers suggested are representative of general
cases. Should verify.