Add terms and date histogram aggregations

Adds support for performing terms and date histogram aggregations.  The implementation is still pretty young, but I'm not very familiar with haskell, so I wanted to submit a pull req early on and get some feedback before investing a ton of time on it.


Never ever inline record syntax into a sum type. It produces partial functions.

To see what I mean, run the dateFormat accessor against a TermsAggregation record.