Fixed state_thunk and keymap_method to be library functions.