Replicate event listener changes

Track event listener changes that occur after initialization and include them in the replication state. Deconstruct listener functions synthesized at runtime into JSON-serializable objects as with `branch/replicate-methods`.

@eric79, can you review?