Added the convenience method Promise.when