Formatting fixes + .editorconfig

* Removed trailing whitespace
* Use 4-space tab in JavaScript files consistently