Rewrite lib/index.js
Merge pull request #500 from kevva/rewrite-index

Rewrite lib/index.js
.gitignore: Changes patterns for new structure.