Integrated wastewater treatment system