Waveguide-integrated digital metamaterials for wavelength, mode and polarization demultiplexing