Fixd jshint issues.
Started adding unit tests.