Add utility method to get the entity which has the main influence on a
tile.
Fix bug when finding neighboring empires.
Avoid NPE when applying treaties.