Updated for Node v0.10 and newer versions of Q.