Coordination polymers derived from magnesium and barium complexes of redox-active ligands