Changed the collision detection system in the Pygame implementation.

The new system is about twice as fast as the old system. Thanks to
Emilio for writing the program that I used to test this.

The change also fixes a minor bug that was present in the old
system: the reason the old system was slow was because of
redundancies in collision checks, and these collision check
redundancies would also cause multiple collision events in one
frame. This will no longer happen now.