Made IsEnemy/FriendlyEntityName more efficient

Typed these all by hand, so tell me if anything is wrong.