added .jshintrc and .editorconfig. Tidied up main js