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
Make $.range generic
Merge pull request #27 from nubbel/feature/generic-range

Make $.range generic
Make $.first and $.last generic functions.
Fix $.difference function.

The "as" operator is not the canonical way of unwrapping optional!
Merge pull request #28 from nubbel/feature/generic-first-last

Make $.first and $.last generic functions.
Merge pull request #25 from zolrath/master

Add partition, partitionAll, partitionBy