test for NPM_CONFIG_OPTIONAL and debug output for all npm config vars

- Ensure that optional dependencies work as expected (and are controlled by `NPM_CONFIG_OPTIONAL`).
- List all npm config vars, not just `NPM_CONFIG_PRODUCTION`