Convert for using .to_json

This will support additional cases of encoding, like where the expected result only is a single object (like a string).
Merge pull request #6 from nj/json_string_support

Convert for using .to_json