Extends the Angular.JS promise API with useful methods