Refactoring Notebook.command_mode.
Removing conditionals that are not needed.
Make sure we are in command mode before we select a new cell.
Merge pull request #5268 from ellisonbg/cmd-mode

Refactoring Notebook.command_mode