Fixed #1919 -- filter truncatewords is inefficient and destroys white space

Used @arien's patch and @SmileyChris' comments, integrated with current code, hopefully made even more efficient for long strings by not splitting and rejoining them.

https://code.djangoproject.com/ticket/1919
newlines being stripped is a documented behavior and needs to remain, I think. Here's a test that passes now and fails after your patch.
```
self.assertEqual(
    truncatewords('Text with a newline\n in the middle', 10),
    'Text with a newline in the middle')
```