Electronic and magnetic properties of the different phases of Ti4O7from density functional theory