Add more SDL2 functions, refactor some things