Hashconsing of tags and events during recording to avoid recording the same event twice. Also implemented custom toString for traces, since JSON.stringify seems slow and sometimes gets overwritten by frameworks anyway.