Fix S3 caching

Fix some JSLint errors, one of which cased us to use the global scope, which led to buggy caching.

/cc @hampelm