Moving document population from persistence into Document class (preparing for refactoring making CodeMirror's Doc generated on-demand, which should save a lot of performance for those large 'd.ts' files.