updated readme and added index.js
fixed module interface