Moiré photonics and optoelectronics