Improve test script

add usage
verify flag value for -i is numeric
allow multiple targets on the command line
actually capture coverage output
fix lingering GOFLAGS undef issue
fix issue with -i not working at all: ((x++)) returns 1 when x is 0, which is
  incompatible with "set -e"
Merge pull request #1116 from thockin/build_cleanups

Improve test script