Serialize closures (anonymous functions)