Moved the configuration out of main. Made config precedence clear.


1. Moved all server configuration to its own package and cleaned up the
   code a bit so that all config is done during startup.
2. Set a clear precedence for configuration.
   defaults->env->cmd line args