testSet.php good to go hopefully

Put together the logic for testSet.php, and made some tweaks / little
edits along the way to some other files.