Add methods

Hi,

As I said previously, there was a bug with group_by, and "timeframe" didn't allow to specify absolute timeframe as outlined in the doc.

This PR adds a custom filter that either returns the string if it is a string, or encode to JSON if it is an array.

Could you tag 2.1 once this is merged please ? :)