add nodeType test for removeClass, and move the one from addClass to top