Add JSON to result file. closes #635

Including tests and docs