Make LineEdit and the REPL re-entrant

Previously, the keymap functions were assigned a name with the eval macro (in global scope). This changes the keymap macro to instead return an anonymous function so that additional instances of the REPL don't clobber the keymap functions of previous ones.