syntax: move functions from deriving/mod to deriving/generic.

These are now only called in generic and can be private. This
includes manually inlining/merging some that are called once.
syntax: move expand_generic_deriving to be a method on TraitDef
syntax: rewrite deriving(Ord) to not require Eq.

lt and gt are implement directly in terms of the corresponding
method on their elements, and le and ge are the negations of these.
auto merge of #6988 : huonw/rust/deriving-changes, r=Aatch

Several minor changes:
 - The clean-up I mentioned in #6851 (moving functions from deriving/mod.rs to deriving/generic.rs)
 - Move `expand_generic_deriving` to a method
 - Reimplement `deriving(Ord)` with no dependence on `Eq`