Add .eslintrc, .eslintignore and fix most reported errors.
Merge pull request #3 from anaran/add-eslint

Add .eslintrc, .eslintignore and fix most reported errors.