Implements a "sorted collisions" implementation, to fix problems with collisions firing multiple times and out of order.