C++11

Reference #1401.

Change much stuff to use new library.
The thread naming facility needs to be retained for debugging purposes. Otherwise debugging the threads is needlessly complicated.