Oil and gas wastewater treatment