use TH to eliminate boilerplate and repetition

Implementation of e.g. "alg" Header Parameters involved a lot of
repetition and some ugly implementation details (building multiple
maps for decode/encode lookups, derived Hashable instances).

Use Template Haskell to eliminate lots of boilerplate and repetition
and dispense with the HashMap-based implementation of these types
and their FromJSON/ToJSON instances.