(Apple) Move code out of main.m (ObjC) and into platform_apple (C)