Add an Args class with backward compatibility for the old args API (#575)
The idea of this is to make a proper C++ API while at the same time
implementing most of the old legacy args API. This makes it possible to
refactor call sites gradually instead of in a series of large
refactoring steps.
Given that “struct args* args” is replaced with “Args args”, the
following types of legacy API usage can be kept without source changes:
1. The args_* functions can be used as is.
2. args->argv[i] still works for read access.
Things that aren’t emulated:
1. args->argc (use args.size() instead).
2. args->argv to access the underlying char* array (use
args.to_argv().data() instead).
3. Mutating the args->argv[i] string in place (don’t do that).
In other words, code that uses args_foo(args, ...) and args->argv[i] can
easily be converted to args.bar(...) and args[i] (with std::string
arguments instead of char*) at will and in arbitrarily small steps.