Clang tidy fixes
Builds on !1225 (merged) .
Applied some but not all fixes. Main fix I didn't apply is for https://clang.llvm.org/extra/clang-tidy/checks/bugprone-reserved-identifier.html which is fairly dramatic. And, in the process of reviewing fixes, sometimes fixed things better.