Do some of this in parallel.  More refactoring.

Ultimately, I'd like to do a lot more in parallel, but we'll need to
change a lot to be threadsafe.