Metasurface-Based Optoelectronic Devices for Polarization Detection and Ultrafast Optical Modulation