tidy-up copyright header, imports and comments split test and visitor into separate classes (thats how it was done originally, but I made them nested static classes, then changed my mind!)