Also remove namespace core for tests.
Move AgentDelegate inside class Agent.