Move varint, varstr parsing to BinaryParser for wider sharing of code.