update varstruct, and use signed-varint
refactor out codex, add timestamp and timezone