Electronic structure and stability of different crystal phases of magnesium oxide.