But (as another comment says) documents should not be apps; they are should be separate. (Although there is the case where sometimes you want to embed apps in documents, such as to make an interactive demonstration of some algorithm, or to include inline currency conversion, to validate or autocalculate a form, or whatever. But the document needs to be readable even if the code doesn't run, and the code probably shouldn't run by default. Also, I think such embedded apps should perhaps be separate frames even if enabled, and do not need to do as much stuff as is now exposed to JavaScript interfaces.)
The modern web is also overused. Often, there are better file formats (e.g. plain text), protocols (e.g. IRC, NNTP, Gopher), etc, that can do as well, or better. Or even existing features of HTML and so on, which you can use but they use worse ones instead.