Trim trailing whitespace from JS files and README
Add missing final newlines from JS files
Merge pull request #5199 from treyhunner/fix-whitespace

Fix whitespace