C++11

Reference #1401.

Change much stuff to use new library.
This line is now rather long and complicated. Use a variable to split the line into two.