fixes for Element.focus

Element.focus() didn't set focus but appears to be used pretty
consistently by the rest of the code to set the focus.  This patch
makes that happen