Initial attempt at implementing appReadyDeferred

This is an attempt to fix this remaining crash of #7683 :

* Crash on close *only* seems to happen if there is a file that gets opened at startup.
* Only happens if file is **JavaScript** or is an HTML file that references a JS file
* If I hit Ctrl-Q before file is shown in editor (i.e. can still see "code the web"), then there's no crash
* If I wait a few seconds after file is shown in editor before Ctrl-Q, then there's no crash
* Best way to reproduce crash is to hit Ctrl-Q as soon as you see any file contents

So, the *remaining* crash seems to point to **JS Code Hints**.

@dangoor - This is my first attempt to implement the solution that we talked about. This does not fix crash, but I wanted to post code for review to see if I'm on the right track.