Using numerous NSLog's led to the discovery that when McBopofomo lost function (as described in #86), -setValue:forTag:client: was often called not just on the context of the foreground app, but also on the contexts of the background apps. This led to the theory that calling keyboard layout override in that method (not a documented way of doing things anyways) might corrupt the input method context. That we swapped out language model and the builder when the method got called didn't help. In this commit, we put back the keyboard layout override code to where it belongs -- in -activateServer: -- and we now only swap the language model and re-create the builder if the input method really changes (e.g. from Bopomofo to Plain Bopomofo, or vice versa). Similar defensive coding is also used in the function key handler in the -handleEvent:client: method.
This reverts commit 95cc888.