improve test/makemain.sh, move queu_pop code to vector class