First Principles Study Of Magnesium/Oxygen Batteries And Glassy Solid Electrolytes