Added feature to put generated JSON into a file.