A model of comet comae. I - Gas-phase chemistry in one dimension