Respect offset and length when iterating over BytesRef in Uid. The length is starting at offset

Closes #2806