Refactor config management and config dialog.
Add default server address if is empty.