refactored findClosestOf

Handles default parameters better
added iterator functions
Merged several classes into abstract class EntityList