Rewrite unsplit to avoid using sed.