For -> forEach + use path module

- Switched from using RegEx to using Node's standard path library to get the extension name
- Switched for loop to for each on files array.
Needs 'var' for lexical scope.  (Alternatively, move the append down to where the comparison happens,
i.e. `if (path.extname(entry) == "." + ext) {`