Extracted Map and Init from thread_work and process_work, resp.

The extraction of init was very clean.  The extraction of Map
is sloppy, and needs to be fixed.  In particular, what map
operations are `blessed' by being in thread_work instead of Map.