A unified mechanism for oxidative coupling and partial oxidation of methane