Add sinon.js to testing suite for better spying, mocking and stubbing

Fixes #847
Test code clean up
Leverage spies and stubs in tests
Merge pull request #856 from cobbweb/feature/add-sinonjs-to-test-suite

Add Sinon.js for better spying, stubbing and mocking