Fix for passing sub-arrays

Support passing part of an array to a function by making a copy of the
array. The array is effectively passed by value not reference so
modifications aren't reflected in the original but that seems to be
correct as per spec.