Fix inconsistent style and add EditorConfig file

For [ticket 22463][].

I haven't yet analyzed the inconsistencies between final newlines in the JSON files.

Some more potential changes that could be made:

- Change code style of JS files to all use 4 spaces for indentation
- Explicitly list each code style (py, xml, js, rst, etc.) instead of using a `*` catch-all section
- Analyze code in tests directory to determine whether some of the inconsistent files (json/xml/po files mostly) should be made consistent

[ticket 22463]: https://code.djangoproject.com/ticket/22463