Custom split line on whitespace and convenient mapping for joining lines