Added unit tests. Added .jshint rules.