Support option handlers in JS

There are null checks commented out because they result in a NPE. I've tested a change to TestOption to use `Integer` and `Double` instead of `int` and `double` - that worked without resulting in NPE. But it would need a change in codegen to enhance this and people could still create options that have primitives without setting them.
That should be an open issue I guess.

Another issue: The docs changed when I generated - haven't pushed them as I'm unsure if that came from me using it wrong or some change in codegen/docgen/whatever triggered that and JS is a bit behind in regard to that.
Can you explain why this results in an NPE?