Add MacOS X support.
Merge pull request #1 from anthonyu/mac_os_x

Add MacOS X support.