Publishing script republishes CMA cases correctly.

To prepare for republishing multiple types of document (other than just
specialist documents) we needed to fix the republishing script to both
operate without errors and to correctly notify the right set of
observers.

The eventual aim is to provide a two-level array of repositories and
the listeners that should be notified which will then perform
republishing for all types of documents.