Use splitlines in new trim function.