Take care around JavaScript reserved word "class"

Addresses #884