prevented removeClass and addClass from affecting the window, + tests