A classList based add/removeClass, setAttribute fallback

In prep for removing the Ember.js `jQuery` dependency on `.addClass`. By using `classList` (with a `setAttribute` fallback) we also gain better performance and SVG compatibility.
cache length for performance here.