Jahn–Teller distortion and electronic structure of LiMn2O4