The design of proteins that switch folds upon stimulation