Remove dependency on Promise.defer.