lib/fold: Add text fold utility