Adding in some tests and the sinon js code
fixing up grunt issues and merge conflicts