A little refactoring in CollisionDetection
Adding some tests to CollisionDetections.js