Move test code into file and test with -S

The move allows us to test all flags in a loop, avoiding
code duplication.
Merge branch 'master' of github.com:dspinellis/sgsh