pgserve_variant: generic value encoding based on mina binary packing.

Signed-off-by: Alex Dubov <oakad@yahoo.com>