Replace CSS utilities with classList methods

Replace the hasClass/addClass/removeClass/toggleClass helper functions
with the classList equivalents (only non-jQuery instances).