Old English þær "in or at that place, so far as, provided that, in that respect," from Proto-Germanic *thær (source also of Old Saxon thar, Old Frisian ther, Middle Low German dar, Middle Dutch daer, Dutch daar, Old High German dar, German da, Gothic þar, Old Norse þar), from PIE *tar- "there" (source also of Sanskrit tar-hi "then"), from root *to- (see the) + adverbial suffix -r.
Interjectional use is recorded from 1530s, used variously to emphasize certainty, encouragement, or consolation. To have been there "had previous experience of some activity" is recorded from 1877.
Old English of, unstressed form of æf (prep., adv.) "away, away from," from Proto-Germanic *af (source also of Old Norse af, Old Frisian af, of "of," Dutch af "off, down," German ab "off, from, down"), from PIE root *apo- "off, away."
The primary sense in Old English still was "away," but it shifted in Middle English with use of the word to translate Latin de, ex, and especially Old French de, which had come to be the substitute for the genitive case. "Of shares with another word of the same length, as, the evil glory of being accessory to more crimes against grammar than any other." [Fowler]
Also by 1837 of in print could be a non-standard or dialectal representation of have as pronounced in unstressed positions (could of, must of, etc.)
Others are reading
Definitions of thereof from WordNet
of or concerning this or that;
a problem and the solution thereof
from that circumstance or source; "atomic formulas and all compounds thence constructible"- W.V.Quine;