Convert most 0/NULL pointers to nullptr

Courtesy of llvm cpp11-migrate 3.3
Convert to autos and ranged loops
More code cleanups