Added re-connect task and cleaned up connect/disconnect for matcherendpointproxy and agentendpointproxy.