Studies on the Electrodeposition of Magnesium in Ionic Liquids