Each and With helpers using function attributes

I realize this is not a favorite pattern to use but in the interest of making things consistent this provides a mechanism to use #each and #with with function attributes.  It was originally merged by ada5a95f9ce9af348e7f0fb223aa78b4762d97d8 but then backed out by ac4d34dbe391773275ee7d3a48ba0270a6a7daff.  This reproduces the original patch but using the functionType comparison used in the #if helper.