Improve normalization of charCode, fix FF not reporting Enter

#1955

Haven't tested it yet (it's late), I'll run it through some manual tests tomorrow.
Nah, we don't like this style. It *shouldn't* exist in any of the other code we have up here (*maybe* some build scripts or tests but we're a bit lax there)