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

Refactor to make $q Promises A+ v1.1 compilant
* Rewrite the promise resolution mechanism
* Remove inline functions from `then`
* Keep and explicit state of the promise