refactored json uses Iterable and has no explicit dependencies on List and Map - passes tests
arg supports -- to signal end of flag processing (getopt compatible)