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
Merge remote-tracking branch 'origin/master' into config-precedence
Fixed missing hostname lookup, and missing pkg in tests
fixed missing usage and added parsing of flags
added documentation for configuring the services
Improved the redis uri sanitization checks and properly handle invalid
flags
made pub service addresses the default
Merge remote-tracking branch 'origin/master' into config-precedence
Merge pull request #19 from egravert/config-precedence

Configuration cleanup