Extract crypt.c, and keymap.c from misc2.c

see issue #209