Add support for parsing JSON supplied as text

This also fixes examples that use JavaScript objects. In JSON single quotes are not allowed.

http://en.wikipedia.org/wiki/JSON#Data_types.2C_syntax_and_example