Fix potential errors due to JavaScript scope
Fix potential errors due to JavaScript scope

There are some potential areas that could cause errors.   These are:
  - Line 21: "err" used to be hoisted to global scope.
  - Lines 132/179/203: "files" is already in scope, it's defined in the parent function.

Some unused global variables are commented out.
theoctal/octalbonescript