refactoring config, and handling the weird connect failure case in which tedious doesn't raise a connect(err) event