Removes all references to the legacy Document.RepublishAll and replaces it's logic with the correct logic.