added index.js
added unit tests