Fix line and file endings.

These changes:
* Add a trailing newline to files that lack one
* Remove double trailing newlines
* Removes trailing spaces and tabs from lines