cleaned up agent code to reduce duplicate code for interval timeouts.
Added PING/PONG logging to connector and fixed some issues in the xml_printer where code analysis indicated a possible path where an uninitialized variable could be used.