Refactor widgets to use JavaScriptCore extension callbacks