Add event_insert method

event_insert inserts a new event into the event list.  If the two event
records have the same event time, it gives preference to the event with the
lowest-numbered event type.

Also added a method test_event_insert, it just tests it.