Update pathfinding

- Pathfinding now avoids enemies.
Various bug fixes