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.