Implement custom keyboard shortcuts support with a user key map file.

Will add JSDoc later.
As a general rule, including an "am I running in a test?" block in production code is a [code smell](http://en.wikipedia.org/wiki/Code_smell). I took a brief look at this this morning and the fix for this may be non-trivial because of the timing involved.