Added replace() convenience method.
Key dispatch, repeated fn revamp; added yank-pop.

We now dispatch in two phases: when we get a key press event, we create a
KeyPress using the key code associated with the key press and check whether we
have a fn mapped to that KeyPress. If so, we dispatch it, if not we defer to
the follow-on key typed event (if any). When the key typed event comes in, we
create a KeyPress using the actual typed character and then look for a mapping
based on that. If we don't find one, and the KeyPress is a candidate for
default-fn dispatch (no modifiers pressed other than shift; has valid UTF8 text
associated with the key press), then we dispatch the default-fn (which is
self-insert-command in a normal editing mode).

This eliminates the special casery we had around self-insert-command before and
fixes an issue I was having with repeated-fn tracking, since
self-insert-command wasn't being tracked like other fns and thus wouldn't
properly interrupt two consecutive yanks, for example.

I also revamped repeated-fn tracking because some commands (yank-pop) need not
only to know if they were repeatedly invoked, but also if they were invoked
immediately after some other command (in yank-pop's case: yank). So now we just
expose the currently executing fn (by name) and the previously executed fn (by
name), and let the fn do what it may with that.

I also implemented yank-pop, which now works properly based on all the other
changes. Yeah, I should have split these commits up, but PITA.