Refactor selection of repository/observer based on argument

Move the complex logic used to choose the document type to be
republished, and obtain its observers and registries down into a
testable class and away from the (untested) republish_documents script.
Use structs rather than 2-element arrays for repository/observers collection