Detoxification of water and wastewater by advanced oxidation processes