Agent/resource_management code cleanup and unit test changes
Added some input validation for agent provider