Fix codec issue w.r.t. `varint`.

Also move over relevant tests from `cql-test` repository.