Make sure shell is focused in contextMenuItemTextText. Fixes #493

Also exception is thrown, when no control has focus when trying to get
context menu (until now NPE was thrown).
Refactored WidgetHandler. Fixes #519