Optimize environment lookup to happen once only

`process.env` lookup results in a synchronous syscall to `getenv()`,
thus should be avoided in hot code.

Add `request.debug` to allow setting debugging mode at runtime.
Merge pull request #403 from mmalecki/optimize-env-lookup

Optimize environment lookup to happen once only