Json: added check if json extensions is installed and enabled

When the json extension is not enabled, calling Json::encode fails due to setting 'display_errors' off with no message. This can happen when using Tester with no php.ini file.