Group events in Javascript (cluster by Event Aggregation)