Replica ready

Can we have this handler use the same semantics as the onreplicamasterwrite, that is to say 
assign this
query_data = @pending_queries[msg.queryId]
and use it instead of referencing @pending_queries here, and below using the query_data technique.

Just makes it clearer