Refactored index.js;
Updated inline docs;
Updated documentation;