Advanced wastewater treatment, recycling and reuse