fixed two bugs in the core add and remove class methods, ported over from framework based to raw JS