System working

- LOGOUT added
- Refactoring of some code
- Debug initialization code