(moved pretty much everything that relates to scope in scope.js, added a module for NodeJS that can be used with require() and exports everything.)