Linted and replaced array.map polyfill with the proper version from MDN

Removed trailing commas, added semis where appropriate, and replaced the array.map polyfill with the "official" version from MDN -- apparently the version used here previously was not the proper and complete implementation.
If this fixes a separate bug can you put it in a different PR?