A comparison between the electrochemical behavior of reversible magnesium and lithium electrodes