Worker IO refactor 3

Creating the IAgent interface and AgentSender class to serialize calls
@davidfowl @abnanda1