Change the parameter order of foreach_leading to be consistent

"metadata, data" instead of "data, metadata"
Merge pull request #38 from mwiebe/foreach_leading

Change the parameter order of foreach_leading to be consistent