refactor($q): make $q Promises A+ v1.1 compilant

Refactor to make $q Promises A+ v1.1 compilant
why `while (ii < pending.length)` ? pending doesn't change, so it doesn't make much sense here