Changed the Agent class to be more generic and support more entity types, and updated references