Replace uses of doc.url with _server.pathToUrl()
Fix doc-out-of-sync handling for non-live HTML documents and generalize the logic so it will work for any non-live doc
Add unit test for 5317 (JS portion)
Add status checks to unit tests for cases where the live doc shouldn't be marked dirty
Merge pull request #6126 from adobe/nj/issue-5317

Replace uses of doc.url with _server.pathToUrl()