Thermochemical conversion of biomass