Added a cleanitem function, this replaces newlines with a space. Currently this is used in the add, append, prepend and replace actions.