Factor out foldable better to reduce code duplication.  There is now a "double
dispatch" pattern that lets you easily write new folders and then apply them to
various structures, reusing the "folding" effort.
Remove a workaround for deriving(Clone) on unit structs.
auto merge of #14168 : zwarich/rust/deriving-clone, r=alexcrichton
auto merge of #14158 : nikomatsakis/rust/issue-5527-refactor-foldable, r=pcwalton

Factor out foldable better to reduce code duplication. 

r? @pcwalton (probably want to let travis run...)