Minor improvements to Query.  Upgraded when.js to 2.7.