Added ArrayFuncs.map function which flexibly maps an array to another by
performing lookups.