Fixed window resize bug and added turn tracker, plus some minor refactoring.