updated widget javascript to use requirejs