Variable integer encoding/decoding tools