Cleanup

Some cleanup in the middleware.js file
Added an editorconfig to keep things consistent
Don't most people prefer tabs in code and the package.json is the only place where spaces are preferred?