Jahn—Teller Distortions in Transition Metal Compounds, and Their Importance in Functional Molecular and Inorganic Materials