Thermochemical and biological conversion of biomass to energy