Basic game loop and core class.