Add JSON output format. Avoid needless complexity around URI/URL handlin...

...g.