Renamed Module into Document, added the concept of ExternalModule (in addition to InternalModule), fixed the mess with types from external files, added tests for all that.
Merge branch 'master' of https://github.com/erecruit/TsT