Implements relationship resolvation + tests.