Evolutionary dynamics of prokaryotic transcriptional regulatory networks