Remove trailing whitespace and add/remove newlines where necessary

* Clean up whitespace
* Make all files end with one newline