Split out MPI helper functions into a separate directory.

Switch to using user-level threading for dealing with MPI,
which simplifies things dramatically.