Ion-chelating polymers carrying macrocyclic ligands