Some bugfixes to the engine.
Added test_battle13.py, a test for 3-way battles.