use a switch statement rather than if-else if chain

drive-by:
  * remove some debugging output from a test -> squash a warning
  * make test.sh default to quiet mode