Fix most if not all of the known NPC AI issues.

Wandering, fleeing, inspecting all work much better now.