pickle Overloaded objects, with some limitations

See issue #795.

Closures are supported but the values are frozen when pickling. The function is analyzed to know which globals variables are necessary, those must be picklable.