Use GWT way to get $wnd instead of maintain our own jsni code
Changes in regexp to avoid js errors when importing compressed js files.