Removed uses of the core forEach method for loops, as it's not supported in IE8.