Methods for the microfabrication of magnesium