The development and applications of terahertz quantum cascade lasers