fixed issue with loadFile

- if the directory contained files which were not .js the next() command wasn't called
- added tests to duplicate and resolve