Improve frequencies method

Now allow frequencies to be passed a function.
The resulting dictionary will be the frequency of results when applying
the function.
Merge pull request #26 from zolrath/extended-frequencies

Improve frequencies method