Adding some testing dependencies
Added mocha tests, and fixed a bug.