Add some tests with some common 'wrong' cases
Use the HTML5 classList API in supported browsers.
Fixing classList for weird cases
merge: Use classList in Element where available. (#2543)

This change optimises and fixes certain behaviour in Element's addClass,
hasClass and removeClass methods. The behaviour fixed is an undocumented
way to handle multiple classes through these methods.

The decision was made to not introduce a potential breaking change (even
though undocumented) in this stage of 1.5 development. The undocumented
behaviour may be (re)moved for a next major release.

Closes #2543.
Opens #2594.