Calculate selected node on change and emit contextChange

What we were calling 'selectedNodes' were actually the start and end
branch nodes. In addition to this we also care if the inner selected
node changes, so emit a contextChange for that, and in context check
that for a change before closing an inspector.

Bug: 71131
Change-Id: I1596bb98189f8233e5a36f96a119f6b052c59360
Merge "Calculate selected node on change and emit contextChange"