Dependency injection > globals/static.

In addition, this way the visitor's destructor actually gets called at
the end of the program and might do something useful.