P2p relationships

Adds relationships to the parser, I want to improve the quality of the code because now there is a stack of 4 `foreach` calls. But the code is ready to be tested.

Reference #79, #112 
Regardless of whether there were hook docs there before, it would be lovely to have them now.