Since they both depend on library that cannot run on python2.4,
cf https://github.com/ansible/ansible/pull/15870, we can use
directly the python 2.6 syntax, as seen on the porting doc.
Some do not use the json module directly so don't need import json.
Some needed to fallback to simplejson with no traceback if neither was installed
Fixes#1298