Import new (much simpler) resolver code from Hybrid.