Add a JSON library.
Assigning global optargs can be simpler.
Fix name reference.