Add support for JSON formatting

Resolves #2