Use promise instead of q for promises, which is simpler.