Separated the SDL stuff into init, mainLoop, destroy