Transition metal carbides and nitrides as catalysts for thermochemical reactions