Add caching around DefaultDependencyDescriptor's doesExclude.

This adds caching around exclude rules. In that small sample that I tested, this change has reduced the overheads from having exclude rules significantly.