Total game loop overhaul, involving refactoring utility methods to a standalone class