The evolution of genetic regulatory systems in bacteria