Common up some code in the conversion to nullable and non-nullable primitive types.
Simplify the code flow in the conversion to primitive types so that default values are handled together.
Common up some more code in the handling of default values for primitive types.
auto merge of #1848 : Ms2ger/servo/refactor-primitive-fromjsval, r=jdm

Probably best read commit-by-commit.