Refactoring Notebook.command_mode.
Removing conditionals that are not needed.
Make sure we are in command mode before we select a new cell.
Don't run PYTHONSTARTUP file if a file, code or module is passed

This is in line with how Python behaves
Simplify logic
Merge pull request #5226 from bouk/fix-pythonstartup

Don't run PYTHONSTARTUP file if a file or code is passed
Merge pull request #5268 from ellisonbg/cmd-mode

Refactoring Notebook.command_mode