Update documentation, fix some typos.
Improve algorithm for indices.
Add type list (Issue #22)