Refactoring complete. Begin work on better AI.