Close GH-727: Fixed windowLoaded not setting on async script load. Fixes #727