Some API work for string comparisons

We have string comparisons working with the XP-compatible API, though we
have some inefficiency with string casting.