Completelly updated to generate full modules from TS files.