[#59] Factorized the `collide` and `collideType` functions, added recursive search, and moved them into `EntityContainer`

while waiting for ticket #103 :)