Add and remove classes to/from DOM elements