Make client refer to an environment settings object rather than a JavaScript global environment

See https://www.w3.org/Bugs/Public/show_bug.cgi?id=26836 for context.

Client itself might be renamed later on.