Exported ModeFlag and added Mode() method.

Also, corrected cursor movement behavior.