slicer: added an array utility method

This is a utility method to slice an array and invoke callback on each slice.