changing how class escaping works

Aiming to fix #548.  I'm not sure if there's some other case where we need `s/class:/"class:"`, so possibly I'm missing something. The tests do pass, though.