Event App Link Ordering

Implemented proper (?) ordering for the event app links.

Ordering is as follows:

• If a link has an “importance” value, it’s ordered based on those
values, from smallest to largest.  If “importance” is NULL the
“importance” value that the row is sorted based on is set to “~0” (which
results in the largest possible integer) so that all NULL “importance”
fields order after NOT NULL “importance” fields (instead of the
opposite, which is the default).
• If two links have equal “importance”, they’re sorted based on their
start time, from soonest to latest, with NULLs sorting last.
• If two links have equal “importance” and start time, they’re ordered
based on their end time, from soonest to latest, with NULLs sorting
last.
• If none of these sorting criteria are met, they’re sorted
alphabetically.