Add encoding length function.
Change everything to unsigned.
Docs for varint_encoding_length.