Implement a cleaner way of dealing with optional arguments in codegen and use it for primitive types.

This puts the Some constructor outside the match, making the actual
generating code independent of the optionality of the argument.
Use handleOptional for the 'any' conversion.
Use handleOptional for the union conversion.

Note that unions didn't handle optional arguments correctly before.
Use handleOptional for the DOMString conversion.
Use handleOptional for the enumeration conversion.
Move optional/nullable handling out of CastableObjectUnwrapper.

This puts the code that wraps the type in Option<> and the code that wraps
the expression in Some() into the same if block, which should clarify the
code.
Use handleOptional for interface conversion.
Use handleOptional for dictionary conversion.

This does not have any effect, as isOptional is always False for dictionaries.
This change is made only for consistency.
Use handleOptional for callback interface conversion.
auto merge of #2244 : Ms2ger/servo/optional-rewrite, r=jdm

This moves all handling of `isOptional` (except `type.isCallback()`, which I believe @jdm is rewriting in #2204) into one place.