General refactoring of the configuration and UI files.

- Refactoring and correction on the config reading and writing: changed
to singleton implementation to remove repeated code and moved to a
"data" global folder;
- Re-organization of the UI files.