Huge improvement to collision system.

The collision detection is much more efficient now, but there are some minor issues which rarely present themselves.