big changes

major refactoring of the gui code; temporarily in gui2.*