fix use of setAttribute/getAttribute for setting className on Element instances (this is broken on IE, and possibly slower too)