Various code tidying up to use newer C++11 and 1706 features but would have been too late for the June code-freeze.