Completely rewrite the code to convert JSVals to unions.

This code works correctly for the two unions currently in use, and raises
exceptions in codegen for most other cases. I will implement those cases when
the need arises.
auto merge of #1875 : Ms2ger/servo/unions, r=jdm

This code works correctly for the two unions currently in use, and raises
exceptions in codegen for most other cases. I will implement those cases when
the need arises.