Fix subslice.
Better handling of empty shards.
Move slice operations into sliceutil.