Port over changes to the ScriptSnapshot API from the languageService-v2 branch.

Port over changes to the ScriptSnapshot API from the languageService-v2 branch.