Handle className correctly for SVG nodes

Bring back the DOM mutator to check if the className we're writing
to is actually a string.

For SVG nodes, the className property is not of type string but
and SVGAnimatedString and writing to the property will cause
a "TypeError: setting a property that has only a getter"
(See http://jsfiddle.net/ca47V/ )

This first checks if the className property is indeed a string
and uses setAttribute() / removeAttribute() otherwise.