miscellaneous cleanup & bugfix for main.cc
clean up emit testsuite, add explicit -p3
modify main.cc to use getopt_long