Ditch the [].forEach.call(NodeList) hack

Making the code more sensible and future-proof. Switch to using custom
forEach method instead of the [].forEach.call(…) hack.