HUGE fixes to the events query - faster, more correct, can in future list infinite events when requested.