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.

Added a comment about _1_ and factored out `component = component || {}` for _3_ since a fix in `branch/kernel-listeners` required revisiting this.