Toggle switch residues control allosteric transitions in bacterial adhesins by participating in a concerted repacking of the protein core