Fix #178 (CSSClassApplier crashes when used with custom NS elements)

The CSS class & className attributes are only available on HTML elements.
Cope with these variables being undefined.

In addition, only remove or merge elements that are in the HTML namespace.

This patch is public domain, so feel free to do with it as you will.