2D Materials for Infrared and Terahertz Detectors