Some improvements and tests for detecting types that are specified as bounds.

+review REVIEW-5226
 Improvements to dealing with ID-less plugins and general polishing.

+review REVIEW-5214