Mechanisms of N2O production in biological wastewater treatment under nitrifying and denitrifying conditions.