Biological removal of phosphorus from wastewaters by alternating aerobic and anaerobic conditions