pH and pIon control in process and waste streams