Add JSON encode.decode helper methods.
Use the JSON encode/decode helper methods.

This is to ensure only arrays/objects are JSON encoded. And to ensure
Only JSON encoded strings are decoded.
Correct on() click usage.