Factored out IME switch to its own function.  Figured out how to make Toast notifications work properly.