Adds function foreach() and foreachPartition().
add Rd file for foreach and foreachPartition.
fix review comments.
Merge pull request #111 from hlin09/hlin09

Adds function foreach() and foreachPartition(). It might help benchmark functions.