Added options for flat-files and json output.