fix up parallel monte carlo pi example
add some parameterized typing
change environment setup script to set up M2_HOME