OSX, ImageMagick >= 6.8.5, and boost >= 1.54 compilation fixes

A bunch of commits which fix OSX compilation, as well as compatibility with the latest ImageMagick and boost releases