first step towards using varint in serialization.

serialize arrays of integers with varints
as well as regular integers