Facile Synthesis of MgFe2O4 Nanoparticles by Green and Chemical Methods for Comparative Analysis on Wastewater Treatment and Antibacterial Properties