--format= option for CLI list command

It would be nice to have a way to dump all variables as JSON, which can be used by many other tools. I'd propose addition of a --json or -j option on the "list" command.

I'd be happy to submit a pull request if it sounds interesting.