made hideKeyboard more robust

Robustified hideKeyboard code.  Works with existing tests but will be adding new functional tests for swipe fallback.
I'm open to what @jlipps has to say. If my opinion isn't clear, let me know.