Record listener context as node IDs instead of node references.

Otherwise, load order matters. An event's listeners would only resolve
correctly if the listening node loaded before the firing node. With
context stored as a node ID, the listening node only needs to load
before the event actually fires.
Test for b35c711: Record listener context as node IDs instead of node references.
Correct the `Listener` `context` field name.