Use package.path and package.cpath to find modules (if they're defined); ignore DSOs when scanning files; ignore thrlua & scriptlet special modules; ignore Lua 5.1 package & module in global scope.
Get build dir from ECSRCDIR env var
Consider variables defined in the global scope to have been declared.