Fix parser errors for types not in current file.

With a type defined in the project but not in the current file the
parser was reporting an error since it was unable to find the type.
Now all the files are added to the TypeScriptContext before the
semantic errors are checked for. Previously the files were incorrectly
being added after the semantic errors were checked for.