Use strict mode in request

Catch a few hidden bugs caused by accidental global variables, and enable strict mode so that bugs like this aren't ever introduced again.

Related: #1103