Fix type variables in serialization

Unfortunately this one cannot be merged as-is because the serialization code has changed since. But the concept is pretty simple. Presently,

    data Either a b = Left a | Right b
    printRight :: Either Int String -> Fay ()
    printRight = ffi "console.log(%1)"

will not work because the `b` is ignored, the type variable `a` will be indexed in both cases. See commit for how this should be done. I will try to update the new serialization code later if someone else doesn't.