First draft of relationship mapping.
Added missing imports.
Simplified implementation.