changed deriving mechanism

The 'deriving' clause for primitive vectors doesn't work anymore;
apparently it was never supposed to work.  Using template haskell now,
which is cleaner and works on GHC 7.8, too, and not just by accident.
silenced warnings and repaired building of pdf