Make optimization more deterministic
Make OrderedSet pickable
(so fix tests broken by the previous commit that use them more frequently)
Add comment
Make OrderedSet pickable in more cases, by doing manual weakref.

Why do it use weakref anyway for the Link?
Merge pull request #2074 from nouiz/opt_order

Make optimization more deterministic