Added .gitignore.
Added unitests using Karma and Jasmine.
Added changes/fixes for the unit tests. All tests now pass.