Partial fix for #4278 -- the performance aspects
unevaluated_resources was a performance bottleneck and was doing a great deal
of unneeded work, such as searching for the type of evaluated resources before
ignoring them because only unevaluated resources were wanted.
This patch is behaviour neutral but gives a 2-3x speedup for compiles with many
defined resources.