Microbial activity and population structure of anaerobic sludge alternately exposed to mesophilic and thermophilic conditions