Converting biomass to bioenergy and bio-chemicals