C++11

Reference #1401.

Change much stuff to use new library.
Perhaps wait till C++14 then where they are defined by default?