Add AgentRegistry for managing agent ids

See issue #42, #48