Added wca.events and we now compute wca.eventByCode from it. This
reduces some duplication, and ensures that we always iterate over events
in the same order. I do not believe there is any guarantee that
browsers will all do the same thing when iterating over object keys.