Merge a few redundant structures in replication relay code.

Simplify replication relay code. Rename a global variable
to a name that doesn't match a type name (simplifies debugging).