Tuning the stability of CaCO3 crystals with magnesium ions for the formation of aragonite thin films on organic polymer templates.