Some long overdue cleanup/reorganization in stream.cpp

Merge Datasource/DataSourceManager, leaving DataSource as the primary interface
for opening a template list. Introduce an alternate hieararchy for things that
are done to individual templates.

Rename FirstStage->ReadStage. Drop LastStage as a unique class, it can be
represented as a single threaded stage with a transform that just collects the
templates it receives.

Introduce a separate class contaiing the stream mode enum. This avoids a lot of
circular dependencies, giving us a more sane file layout.
Make progress counter give one last output in its finalize method