Fix autofocus in FF

/cc @jonrohan
Clear out any focused elements before inserting new page contents
Merge pull request #300 from defunkt/refocus

Improve focus emulation