Adding %g and %() syntax

Adding a new flag that expands to the glob expansion match.
The main use case for this is if the command to run changes the basename
of the file:

: foreach *_master.c |> foo %f |> %g_minor.out

This also adds a new syntax for flags: %(<flagname>), ex: %(f).
This is useful to allow for modifiers on a particular flag. For
instance, with the %g flag it can be usefule to add an index.

: foreach *_*.c |> foo %f |> %(g0)_%(g1)_new.out