Add support for OS X. Tested on 10.6.8 and 10.9.1.