[MOD] GUI: Various refactorings in main and popup menu structures.
[FIX] GUI, Opening files: file reference was not closed