Added grunt configurations for tests and eslint, and cleaned up the code a little