Added static AgentRegistry class to handle agents.
Updated existing lua code to use new AgentRegistry class.