Updated to support Yosemite

This updates the code to work on yosemite, it provides no backward
support, you can implement that by looking at the older version.