Fix Trac #2668, and refactor TcDeriv
TcDeriv deals with both standalone and ordinary 'deriving';
and with both data types and 'newtype deriving'. The result
is really rather compilcated and ad hoc. Ryan discovered
#2668; this patch fixes that bug, and makes the internal interfces
#more uniform. Specifically, the business of knocking off
type arguments from the instance type until it matches the kind of the
class, is now done by derivTyData, not mkNewTypeEqn, because the
latter is shared with standalone derriving, whree the trimmed
type application is what the user wrote.