Change 'var' to 'str' in tests

'var' is a reserved word in JavaScript, and so no JS compiler could pass these
tests without modification.