lib: require globals instead of using the global proxy
In addition, use process.stderr instead of console.error when there is no need to swallow the error.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines