Generic secd_first/secd_rest for pairs/vects/strings