Electrowinning rare-earth and uranium metals from their oxides