Updated for_each to use the standard futures
Updated get_num_localities to use the standard futures