Refactoring mac backend to SDL2 backend

Not ready yet just another small portion. Affects only OS X build. OS X build should be working fine.