Refactored some stuff

Main loop function added, now changing the text of something wont redraw
its texture.