Electronic properties of transition-metal oxides—I: Distortions from cubic symmetry