Fixes related to new SDL interface
Flush only relevant functions
Missing threading SDL function definitions
Switch to new SDL interface for drawing and event handling