Move collision logic to entities

Change-Id: Icb2ce23dc3b3067062f50759f204a80e369b4532