Cleanup and OSX fixes.

Clean up some compilation issues on OSX:
  * unsigned {long} casts
  * Cocoa and SDLMain dependency
  * ignore unused private variable warning