SDL: add support for SDL2

As the title says, this set of patches adds initial support for SDL2.
The commit messages for each patch should contain an explanation to deficiencies
in the related areas, but one thing that is not mentioned is that this does not contain support
for explicitly using OpenGL (although it might be the actual backend SDL2 is using to render).

Also, some of the changes might be considered a bit of hacks (the compatibility defines for an instance),
so I'm certainly up for discussion on how to improve on cleanliness.

I've tested the changes on a normal Linux machine, and as far as my tests goes, the changes are
at a state where they are usable (albeit experimental).
There's a relevant discussion about this here:

http://forums.libsdl.org/viewtopic.php?t=8340

To quote:

> There are three options: 
> 
> 1) You just want to know when particular keys are pressed. 
> Answer) Use scancodes, and allow the user to remap keys whenever they want. 
> 
> 2) You want Unicode. 
> Answer) Use the text-editing events, because that's the only way that 
> you can get all Unicode characters. 
> 
> 3) You want to know when keys that map directly to Unicode are pressed. 
> Answer) Use keycodes, checking the high bit to determine if it carries 
> a Unicode value or a scancode value.