move frequencies from recipes

Also give more performant solution
countby depends on frequencies, not groupby
use imap in countby
Merge pull request #17 from mrocklin/frequencies-performance

Frequencies performance