Analytical Modeling of Waveguide-fed Metasurfaces for Microwave Imaging and Beamforming