Changes to viewer to support progressive loading

Separates out some of the viewer changes from #2719.