I'd like to make a change to safeAddClass so that I can make sure it works correctly for SVG elements and SVGAnimatedString class names.

That can wait for a different PR, though.