Cleanup and making sure that Home/End/PageUp/PageDown work as in Vim in insert mode...

This is a little cleanup, and a fix for broken Home/End/PageUp/PageDown in Vim insert mode.