Beginning refactor for AngularJS
Added tests for karma jasmine