SDL2 Window Provider

I manually ported @tito's changes to a fresh master and split it into a separate branch. I considered cherry-picking, but that got really messy, really fast, and manual patches couldn't resolve due to conflicts.