Recent Advances in Functional Materials for Wastewater Treatment: From Materials to Technological Innovations