[Refactoring] Improve performance of searching for type definitions by minimising the number of assemblies that get a compilation.