Error handling kafka

added handling for IO Exceptions when talking to Kafka. Also changed the way that Kafka error codes are detected. IOExceptions are intentionally not handled in the constructor. Making the constructor exception safe might require more refactoring.