In the first two sentences que and qui are indeed relative pronouns, and in a literal translation they could be translated with which:
C’est ce qui me dérange. = It is that (thing) which bothers me.
Sais-tu ce que Pierre a fait ? = Do you know that (thing) which Pierre has done?
But in the third sentence que is not a relative pronoun but a conjunction, and can’t be translated with which. So this:
À qui s’étonnerait de ce qu’un gentleman aussi mystérieux comptât parmi les membres …
–is best translated as:
To anyone who would be surprised that such a mysterious gentleman was among the members…