Replace custom threading with C++11 based threading.