Cleanup arg checking and add auto stash. Refs #6653
Factor out helper routines. Refs #6653
Add git checkbuild command. Refs #6653