Microbial generation of H(2) or CH(4) coupled to wastewater treatment in bioelectrochemical systems