Added a check for the json extension

Debian unstable compiled PHP without the json extension because of
a license issue with the JSON parser used by PHP.
Merge pull request #47 from stof/patch-1

Added a check for the json extension