Adding a tweaked shim for Array.prototype.forEach from
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Compatibility
Utilising classList when available.
stripping superfluous whitespace