Switch from Q promises to when promises (bug 959248)