Every abstract type should be JSONalizable
Dump computer-friendly information in a JSON file on request.

For instance:

    opam upgrade --dry-run --json foo.json

will dump the planned actions in in `foo.json`.

This should fix #665

Bonus: this also work with 'opam update' and gives the list of new/updated/deleted packages and compilers.