Move test code out of "test" package