Stop browser errors on load in browsers without classList.

Initial work on progressive enhancement (#527), stops browsers without classList from getting JS errors on page load.