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

Refactor to make $q Promises A+ v1.1 compilant
it really seems wasteful to me to create all these arrays for $pending, too --- we can just say $pending is like a 1-dimensional grid, it would be less wasteful.

But we can fix that later