Support replication subscription cookie

Subscriber only accept subscribe response with matching cookie. Also added manu unit tests for ReplicationSubscriber (still missing publish unit tests).