ClientHelper#hash_to_json falls back to #to_json

ClientHelper#hash_to_json is unable to serialize a nested hash.
So if available (as when Rails is loaded), fall back to hash.to_json.

A case where it did fail to properly convert to json, was:
  recaptcha_tags(:display =>{:theme =>'custom',:custom_translations => { 'instructions_visual' => "Tralalal" }})