Overhaul unpack_variant, still needs pack support