Major refactor of JasonAI. A* now runs much faster.