fixed index race condition
makefile for test command
added mocha test
version update to 0.1.1