preprocessing: fixes events aggregation

The javascript indexOf() can only be used in plain arrays, not in
Objects, so we should check agains the recordHash's keys.
Also, the keys in associative arrays (aka js hashes) must be strings,
so we need to convert the event.id to string
Fetch the default dataset when loading the page