Mechanisms and Evolution of Control Logic in Prokaryotic Transcriptional Regulation