Refactor 'dev_mode' to 'debug' and 'foreground' options.
Switch message to debug logging.
Fix timeouts