Added auto-wiring of related entities as well as caching and some relationship related helper methods.