These patches split up and simply the process_each functions in preparation for adding new locking. This includes new tests, which pass, for the commands that call the process_each functions. (I've had to comment out the pvresize checks because of an apparent pre-existing bug.)