runtest.pl revised and cleaned up

I've taken the liberty to give the runtest.pl script an overhaul. 
Added the strict pragma, used lexical file handles and did some clean up.