Process and apparatus for producing synthesis gas through thermochemical conversion of biomass and waste materials