X request id replication

here's the functionality I proposed in discussion in #1 (along with some small code improvements)