Purification of Rare Earth Amide Salts by Hydrometallurgy and Electrodeposition of Rare Earth Metals Using Ionic Liquids