cleanup_spaces: Clean up the use of whitespace in a character vector
Description
The function cleanup_spaces() takes a character vector and input and turns
any uninterrupted stretch of whitespace characters into one single space character.
Moreover, it can also remove leading whitespace and trailing whitespace.