"Wrap" will find the first blank line before and after a selection and use this range as a paragraph to wrap. The paragraph is split into words (space delimited) and the length of each word is used to make sure that a single line will not exceed the print margin (ruler) width. If a single word exceeds that width, the word is split.
Also moved closeTab() function into a lambda, since it's confusing to
have both it and removeTab(), and the former only works with the context
menu anyway.