Refactoring of edit mode.

Button to go back to view mode added.
Misc. refactoring of categories and sources configuration.