remove unnecessary calls to $q.defer()

All the calls to `$q.defer()` in the code, except for the one in `pollPopup` are unnecessary. This PC does noes change the semantics of the code, but only simplifies it.

The signature of two methods is changed `shared.setToken` and `popup.pollPopup` since they no longer receive a `deferred` object.