Add a helper class EventFrequency

A helper class to measure frequency of a certain event.

To use this class create an instance and call `event()` function every time the event in question occurs. The estimated frequency can be retrieved with `getFrequency()` function.