Manufacture of polymers containing ionic or ionogenic groups