OS X Compatibility

- OS X has a different type of spinlock, use a compat layer.
- OS X also does not have clock_gettime and CLOCK_MONOTONIC so reimplement these as well
- CMake now can compile from anywhere and not just the current directory (due to not finding the cmake folder in the project root)
- OS X does not have librt; exclude it from CMake target libraries for compile