Integrated switch for mode-division multiplexing (MDM) and wavelength-division multiplexing (WDM)