Refactoring in the CollisionDetecting bot. and related classes.

Refactoring in the CollisionDetecting bot and related classes. Needs
further work.
Code cleanup.

Added additional case in the collision detection. Also cleaned up some
unneeded comments.