Added support for JSON input format to command line tool