Imidazole-containing polymer membranes and methods of use