Handle modes in event method of editor.
The modes are activated in the event() method, so they can now redirect the input inside editor if default behavior is needed.
Fixed shellVariables method and clean spaces in command module.