Work on joining of relations
Implemented joining of relations. Added related tests.