Optimized addClass for non-classList support