Add a Matches() method to support attribute matching.

Attribute matching is necessary in order to support DICOM queries.
The rules for attribute matching are given in DICOM part 4.  This
patch is more-or-less complete, except that it does not yet do
timezone adjustments for date and time comparisons, nor does it do
any normalization for name comparisons.
Add length check to Compare to simplify calling code.
Add CharacterSet check to "char" specialization of Compare.