'Creates the appropriate contexts and persists events. The events
should not depend on one another, e.g. this should be used to persist
a bunch of outliers, but not a chunk of individual events that depend
on each other for state calculations.'

@defer.inlineCallbacks
def _handle_new_events(self, origin, event_infos, backfilled=False):

    contexts = (yield preserve_context_over_deferred(defer.gatherResults([preserve_fn(self._prep_event)(origin, ev_info['event'], state=ev_info.get('state'), auth_events=ev_info.get('auth_events')) for ev_info in event_infos])))
    (yield self.store.persist_events([(ev_info['event'], context) for (ev_info, context) in itertools.izip(event_infos, contexts)], backfilled=backfilled))
