Nitrogen fixation and bacterial photosynthesis: a cascade of gene and operon duplication