Optimize selector performance.

Using attribute selectors should be avoided as much as
possible. IDs should be used where ever possible. If
element isn't unique, default to class based targeting
rather than filtering by attributes.