Electrochemical removal of haloacetic acids in a three