Use classList to improve the class performance

update the hasClass/addClass/removeClass/toggleClass function.
classList api is using by chrome/safari/opera/firefox.
https://developer.mozilla.org/en-US/docs/Web/API/element.classList