Main code of a library defined as module; added mocha tests