Replicate method changes

Track changes that occur to methods after initialization and include them in the replication state. Deconstruct `function` objects synthesized at runtime into a JSON-serializable representations.

@eric79, the actual replication bits are missing still, but this is good to start reviewing.