Updated support for v3 and v4 API

Just updated the code to support the new v3 and v4 API calls for PuppetDB 2.0+