Decouple visualizers from the viewer.

This means that viewers do not need to be instantiated, which caused
problems with headless renderers.