Added json option.
Fixed json + test
Merge pull request #2 from KaiSmith/master

Json option added