Add .editorconfig

Use EditorConfig to define a some basic styling rules for code.  This
should also help to reduce the number of commits introducing trailing
whitespace.

See http://editorconfig.org/ for details.

Apologies for the commits in which I violated the guidelines for contributing.