Added mocha tests and fixed the libraries require path.