Trim trailing white spaces and add new line at eof

I noticed that we have some trailing white spaces and some file doesn't have newline at end of file. 
So I've decided to fix that.
Also I've added `insert_final_newline = true` to `.editorconfig`.