Add frequencies method

$.frequencies counts the number of times each element is repeated within
an array, returning a dictionary with the elements as keys and the
number of repetitions as values.

["a", "a", "b", "c", "a", "b"] == ["a": 3, "b": 2, "c": 1]