Move pre/postorder_traversal to visitor.cpp