Rewrote the code for deriving Eq

 to make it work on more examples and fix some problems.

Note that In this version, deriveEqDef (quote D) expects there to be an instance of (Eq D) in scope, so how you use it is also somewhat different (see DeriveEqTest.agda).