Initial port to macOS

Doesn't work yet as SDL1 is broken on modern macOS.