Miscellaneous fixes

These are a few miscellaneous kernel and javascript driver changes that came out of working with VWF on other projects. They are mostly independent of each other and the preceding changes. But there is one merge conflict, so they're stacked on top of branch/find-trees so that we don't risk a merge error later.

@eric79 please review.

Could the `or` with `{}` be moved into `componentKernelFromJS` so we don't have to repeat it every time it's called?