Add methods to compute length of VarLen encoded ints
Change encoded format

Move cookies to use VarLen encoding to reduce size and also encode
to String using URL Safe Base64 encoding.