Add error handling and IRC logging support