Added support for exporting as JSON #27