change test to know if classList is supported, and define conditionally functions