Engineering Electromagnetic Wavefronts With Metasurfaces