sanity checks IRC() and Connect()

I added some sanity checks to make the code more robust againt errors. IRC() can handle empty strings know (e.g. when autogenerating an instance) and Connect() only establishes a connection if the internal data is well formed. All changes come with tests.