Spatial succession and metabolic properties of functional microbial communities in an anaerobic baffled reactor