Set attributes in recordevent before updatehook

Previously attributes added by updatehook would be overwritten by a later setAttributes() call. While the order doesn't matter much, it seemed more logical to add the attributes when initializing the recordevent object (no reason to delay it, it seems). Don't reuse the original map from the record since otherwise changes done by updatehook would end up there as well (which again wouldn't matter much, but anyway).