Support JSON payloads on 0.6.x

This is simply an extraction of the JSON-related functionality from @johnrengelman's existing pull request: kelseyhightower/confd#102. Thanks @johnrengelman!