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
there is already a scanner created for the LS, just use that one, and set the text to undefined when you are done.