Complete refactoring of the agent to use iPojo with in-memory agents