Cleaned up the code by eslint standards

I have cleaned up the code as per eslint standards.
Added some more test cases.
We have to make a quick change in test file before we merge this file into eslint. You can take a look at other test files inside eslint, you would understand what i am talking about.
Thanks