Removed hard dependencies on SDL in many places.

This will make the game more portable, for example to SDL2 or another graphics library in the future.