Added jscs for style-checking
Clean-up and refactor. Removed dependency on lodash.