Add a special case for comparing values with VR of AT.

If an AT attribute is part of a query, I can only guess that it
is there by mistake.  The safe approach is for it to always match.
The check in CompareEach was reversed.
When comparing dates, make sure to ignore space padding.
Fix some issues with sequence matching for queries.
Fix conversion of matching patterns to UTF8.
Add tests for value matching for queries.

Here are the tests that uncovered the bugs that were fixed in the
last few commits.