Move reusable test code into perfect_test.go; Remove dead test code