Remove duplicate code

The function `makeMap` in `index.js` is the same, except a patch
that was just applied to this function in
3e947bf4fdb6d6adbd399383234c34d4e473f425 which now also applies to
the function that was in events.html
Merge pull request #119 from robertkowalski/duplicate-code

Remove duplicate code