Some renaming, move tester code out of main module