The physical chemistry of polyelectrolytes and ion exchange resins