Carbon nitride formation in gas-phase reactions of CH4, NH3 and H2: an ab initio study