Molecular Junctions for Terahertz Switches and Detectors