Add RubyMotion support for #to_json

+ Check if JSON has been defined