Changes to build on OSX

Verified (build and test) on 
 - OSX 10.9.2, clang Apple LLVM 5.1, boost 1.55 and 
 - Ubuntu 13.10 with gcc 4.8.1, boost 1.53.