Re-use common keysByCode data structure

Rather than create a new `keysByCode` mapping each time the `keypressHelper` factory is used, a common copy is lazily-instantiated the first time it's needed and is shared amongst all instances.