Merge pull request #1 from nouiz/yaoli-optimization_cache

Fix pickling of FunctionGraph.
opt caching pkl optmized graph problem
Fix max recursion problem.
Fix test.
pep8