On the LixCo1-yMgyO2 system upon deintercalation: electrochemical, electronic properties and 7Li MAS NMR studies