Flat optics with dispersion-engineered metasurfaces