Added 'host' config variable.
Minor refactoring.
Minor bugfix.