Splitted the visiting functionality into separate files and added tests for VisitCheck-s.