Support selector syntax for thumbnails in templates

This changes the thumbnail handling from templates from ad-hoc
attributes to a more selector-centric system. The template can specify
one or more thumbnails along with parameter values associated with
those thumbnails. When the user edits an attribute, the wizard
reevaluates the thumbnail and picks the best match (meaning one of the
thumbnails that matches all the parameter values, and among those the
one that matches the most.)

(This changeset also moves the metadata code into a new class.)

Change-Id: Ic75d58573df5b2ea200c6b2861bbf36ce17ea1c3
12 files changed