Refactor gext to build strings instead of building command lines

Simplifies the code a tad. This also adds pruning unwanted directories
and files.