Extracted new class GameEngine.cs
Other minor fixes.