Added an encoder for varint