Close #319: Complete unit tests. Add use of sinon.js for mocks and spy and blanket to test the code coverage. The loop view has been updated as well with input to enter loop length.