refactoring

Refactored editsession
Better save for untitled files
Added mode support

Can now change mode for a source file
More mode support

Editor reacts better on mode changes of an open file. Many mode
dependent features are now on the fly determined.