Start and stop main loop on extension enable/disable