Regulation of dynamic polarity switching in bacteria by a Ras-like G-protein and its cognate GAP