Use ranged for syntax in place of iterator loops.
Convert some obvious cases found by clang-tidy's modernize-loop-convert
checker. Prefer explicit typing to auto. In my view auto does would reduce
readiablity with little gain in maintance cost. Use const while were at it.
Note: Not all suggestions from modernize-loop-convert have been used.
This is intentional. The target here was cases where interator based
looping was in use. Length based looping should not be replaced.