Add host logout command
Fix bugs and refactoring related to config