Clean up the definition loader
Clean up the factory
Work on some of the relationship code
Tests covering new structure