more flexible testing

  including a C script to count the number of out-of-order comparisons
  between list elements and three additional options to test.sh