Merge master to sdl2

This pulls in changes up till right before the whitespace fix.
I merged that separately to make it cleaner, and I'll send the pull req next.