Add CoreFoundation headers for Mac OSX 10.7
Use C++11's cross platform std::chrono and sleep_for instead of usleep