Some initial work for porting slice()