add mocha tests and npm package