Rework preferred external event to use keyfunc; fixes #851
This MR switches the logic in picking a new preferred external event similar to the keyfunc
method in the superevent manager. This simplifies the logic down quite a bit and will make maintaining/adding new features to this system easier in the future.
Edited by Brandon Piotrzkowski