Updated to use new Iotiva SDK and Agent class