Reduce line lengths and remove trailing whitespace