DocuentScriptSnapshot/DocumentState fiddling, build improvements, added auto-patching of typescriptServices.d.ts.