Semiconductor nanowires in terahertz photonics: From spectroscopy to ultrafast nanowire-based devices