Move game loop to core