Structure-property relationship in spinel and rock-salt Li-Mn-Mg-O phases