Fix for IE9 which does not support classList

Added addClass and removeClass functions to support IE9.
IE10 has classList. This change is for IE9 and earlier and other old browsers.