Added JSON support for #8.