Update the viewer to use a separate scope variable

This means that we don't need to override the threading.root when we
want to change the contents of the stream.