Phased-array wavelength demultiplexers and their integration with photodetectors