[WIP] Mac OS X Changes

This is a work in progress but it can be merge as is.  I made this same changes on my mirror (`nandub/gale-old`) I rather made the changes on yours as you made good changes.

However, with this mirror I'm having issues with iconv, but on my mirror I was not getting the error.  I'm getting a segmentation fault when using `gsub`.