Refactor ref files path

This is an initial re-factoring of pre-process files by moving preProcessFile from preCompile.ts into services.ts and use new scanner to perform the tasks. Couple more clean-up and re-factoring are still needed as indicated in TODO comments and they will be added soon
we should condition adding this file on the existence of at least one no-default-lib tag