clean up. add add/remove-class helper functions, remove string.trim-polyfill (ie8 is not supported either way because of the use of addeventlistener)