Updated MPI wrapper to compile with new template. Some cleanup.

TODO: Tests/fixes for OpenMPI.