Added support for processing js files in a project

Also, there were some refactorings and file rearranging to improve code
quality